package com.e_manager.soft.emanager.controller;

abstract public class BasePage {
	private final  int DEFAULT_PAGESIZE = 15;
	/**
	 * 第几页 默认第一页
	 */
	private int pageNumber = 1;
	/**
	 * 一页多少条 默认15条
	 */
	private int pageSize = this.DEFAULT_PAGESIZE;
	
	private String sortBy = "createDate";

	public int getPageNumber() {
		if(pageNumber <= 0){
			pageNumber = 1;
		}
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public int getPageSize() {
		if(pageSize <= 0){
			pageSize = this.DEFAULT_PAGESIZE;
		}
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public String getSortBy() {
		return sortBy;
	}

	public void setSortBy(String sortBy) {
		this.sortBy = sortBy;
	}

	public int getDEFAULT_PAGESIZE() {
		return DEFAULT_PAGESIZE;
	}

}
